#ifndef _NUT_ARG_H
#define _NUT_ARG_H

#include <vector>
#include <string>

typedef std::pair<std::string, std::string> pairParam;
typedef std::vector<pairParam> pairParams;

#define PARE_STR(key)   if( it->first == "-" #key ) {            \
                            this->key = it->second;      \
                        }

#define PARE_INT(key)   if( it->first == "-" #key ) {               \
                            this->key = std::stoi(it->second);    \
                        }

class ParamParse {
public:
    pairParams params;

    ParamParse(int argc, char* argv[]) {
        for ( int i = 0; i < argc; i++ ) {
            int j = i+1;
            if ( j < argc ) {
                pairParam param(argv[i], argv[j]);
                params.push_back(param);
            }
        }
    }

};


#endif // _NUT_ARG_H